package SEApp.boxes.albums
{
	import UIFree.controls.uif_hscrollArea;
	import UIFree.uif_component;
	import UIFree.uif_ecomponent;
	
	import flash.geom.Rectangle;

	public class se_previewItem extends uif_ecomponent {
		protected var _prevImage: se_previewSource;
		protected var _dataItem: *;
		
		public function se_previewItem(parent:uif_component, ax:int=0, ay:int=0, awidth:int=0, aheight:int=0, a_data: Object=null, styleClass:String='') {
			super(parent, ax, ay, awidth, aheight, styleClass);
			_dataItem = a_data;
			createComponents();
		}
		
		protected function createComponents(): void {
			var ir: Rectangle = sourceRect();
			_prevImage = new se_previewSource(this, ir.x, ir.y, ir.width, ir.height, 'preview');
		}
		
		protected function get list(): uif_hscrollArea {
			return parent.parent as uif_hscrollArea;
		}
		
		protected function sourceRect(): Rectangle {
			return getInner();
		}
		
		public function get image(): se_previewSource {
			return _prevImage;
		}
		
		public function get data(): Object {
			return _dataItem;
		} 
		
		override public function get _data():Object {
			return _dataItem;
		}
	}
}